using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;


namespace SMS.Common.Security
{
    public class Tools
    {
        public static string Encryption(string password)
        {
            return ConvertBytesToString((new SHA1CryptoServiceProvider()).ComputeHash(ConvertStringToBytes(password.Trim())));
        }
        private static byte[] ConvertStringToBytes(string input)
        {
            return (new UnicodeEncoding()).GetBytes(input);
        }
        private static string ConvertBytesToString(byte[] input)
        {
            return (BitConverter.ToString(input)).Replace("-", "");
        }
    }
}
